package Tools;

import java.util.*;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.font.effects.ColorEffect;

/** Resource manager class
 * @author Aikidos
 */
public class ResourceManager {
	/** Pool of resource object */
	private static Map<String, Object> _pool = new HashMap<String, Object>();
	
	/** Returns pool of resource object
	 * @return Pool of resource object
	 */
	public static Map<String, Object> getPool() {
		return _pool;
	}
	
	/** Load image
	 * @param fileName - FileName
	 * @return Image
	 */
	public static Image LoadImage(String fileName) throws SlickException {
		return new Image(fileName);
	}
	
	/** Load font
	 * @param fontName - FontName
	 * @param size - Size of font
	 * @param bold - Is bold?
	 * @param italic - Is italic?
	 * @param color - Font color
	 * @return Font
	 */
	public static UnicodeFont LoadFont(String fontName, int size, boolean bold,
			boolean italic, java.awt.Color color) throws SlickException {
		UnicodeFont f = new UnicodeFont(fontName, size, bold, italic);
		f.addAsciiGlyphs();
		f.getEffects().add(new ColorEffect(color));
		f.loadGlyphs();
		
		return f;
	}

}
